<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style th:inline="css">
    .co{
        color: [[${color}]];
    }
</style>
<body>
<!--<div th:include="header::fragment1"></div>-->
<div th:replace="header::fragment1"></div>
<h1>thymeleaf 页面</h1>
<!--th:text-->
    <label th:text="${price}"></label>
    <p th:text="${str}"></p>
    <div th:text="${book.title}"></div>

<!--th:inline 内联-->
    <div class="co" th:inline="text">作者：[[${book.author}]]</div>

<!--th:object 和 *-->
    <div th:object="${book}">
        <div th:text="*{id}"></div>
        <div th:text="*{title}"></div>
        <div th:text="*{author}"></div>
        <div th:text="*{price}"></div>
    </div>

<!--th:each 遍历-->
    <table border="1" cellspacing="0">
        <tr>
            <th>id</th>
            <th>title</th>
            <th>author</th>
            <th>price</th>
        </tr>
        <tr th:each="b:${books}">
            <td th:text="${b.id}"></td>
            <td th:text="${b.title}"></td>
            <td th:text="${b.author}"></td>
            <td th:text="${b.price}"></td>
            <td th:if="${b.price}>40" style="color: red;">太贵了</td><!--表达式成立显示-->
            <td th:unless="${b.price}<40" style="color: red">太贵了_unlees</td><!--表达式不成立显示-->
            <td th:if="${b.price}<40" style="color: green">价格合理</td>

            <td th:switch="${b.price}/10">
                <label th:case="3">建议购买</label>
                <label th:case="4">价格合理</label>
                <label th:case="*">价格不合理</label>
            </td>
        </tr>
    </table>

<!--<div th:include="footer::fragment1"></div>-->
<div th:replace="footer::fragment1"></div>
</body>
</html>